package com.timer.taskRule;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ThreadPoolTest {

    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        ScanRunable runable = new ScanRunable();
        Future<?> submit = executorService.submit(runable);
        

        try {
            Thread.sleep(9000);
            System.out.println("正在关闭");
            executorService.shutdown();

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
